package com.wechatapp.mengyao.poetry.controller;

import com.wechatapp.mengyao.poetry.core.RestResponse;
import com.wechatapp.mengyao.poetry.service.CategoryService;
import com.wechatapp.mengyao.poetry.vo.CategoryView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yanghuaxu
 * @date 2025/7/5 16:46
 */
@RestController
@RequestMapping("/api/v1/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/list")
    public RestResponse<List<CategoryView>> getCategoryList(@RequestParam String mediaType) {

        return RestResponse.ok(categoryService.getAllCategoryList(mediaType));
    }

}
